The present technique provides an apparatus and method for using predicted result values.
A processing unit may comprise processing circuitry for executing a sequence of instructions, and often the processing circuitry is arranged in a pipelined arrangement, so that a number of instructions can be in the process of being executed within the various stages of the pipeline. It is often the case that some instructions are dependent on the result of an earlier instruction, for example because they require as one of their source operands the result produced by that earlier instruction.
To seek to improve performance in such situations, it is known to provide value prediction circuitry that can maintain a predicted result value for one or more instructions. If a predicted result value is available for the earlier instruction mentioned above, this would allow the processing circuitry to start execution of one or more dependent instructions, based on use of the predicted result value. Later it is then necessary to verify that the predicted result value did in fact match the actual result value produced when the earlier instruction was executed, and if the prediction is wrong, the processing circuitry will then need to re-execute the dependent instructions.
Accordingly, there is a microarchitectural dependent penalty associated with a situation where a predicted result value is used, and that later turns out to be an incorrectly predicted result value, due to the number of extra cycles required to return the pipeline to the situation that was present before the mispredicted result value was used. This penalty associated with the use of a wrong predicted result value has to be balanced against the penalty incurred were the apparatus not to make use of predicted result values, and hence where the dependent instructions could not begin to be executed until the actual result value was available. In order to improve the benefits available from the use of predicted result values, it is desirable to reduce the penalty associated with the use of a mispredicted result value. However, it is often the case that predicted result values are used for instructions whose execution incurs a relatively long latency, for example load instructions that miss in one or more levels of cache, and in such situations it can be a significant period of time before the actual result value is available, and hence the situation of a misprediction of the result value can be determined.